<!-- 账号管理 -->
<template>
    <div class="account-list">
        <header>
            <!-- 名称查询 -->
            <div class="search">
                <el-form :inline="true" :model="searchData" class="demo-form-inline">
                    <el-form-item label="姓名">
                        <el-input v-model="searchData.anm_branch_name" placeholder="请输入"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" icon="el-icon-search" @click="search" size="medium">查询</el-button>
                    </el-form-item>
                    <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add" size="medium">添加账号</el-button>
                </el-form>
                
            </div>
            
        </header>
        <!-- 列表 -->
        <div class="list">
            <div class="list-opate">
                <el-table :data="list" style="width: 100%" tooltip-effect="dark">
                    <el-table-column align='center' prop="a_account" label="账号" width="120"></el-table-column>
                    <el-table-column align='center' prop="a_user_name" label="姓名" width="120"></el-table-column>
                    <el-table-column align='center' :formatter="sex" prop="a_sex" label="性别" width="80"></el-table-column>
                    <el-table-column align='center' prop="a_phone" label="手机号" width="120"></el-table-column>
                    <el-table-column align='center' prop="a_emergency" label="紧急联系人" width="120"></el-table-column>
                    <el-table-column align='center' prop="a_emergency_phone" label="紧急联系人电话" width="120"></el-table-column>
                    <el-table-column align='center' prop="a_address" label="现住地址" width="150" show-overflow-tooltip></el-table-column>
                    <el-table-column align='center' prop="a_native_place" label="籍贯" width="150" show-overflow-tooltip></el-table-column>
                    <el-table-column align='center' :formatter="accountState" prop="a_status" label="账号状态" width="120"></el-table-column>
                    <el-table-column align='center' prop="a_create_time" label="创建时间" width="140"></el-table-column>
                    <el-table-column align='center' prop="a_update_time" label="修改时间" width="140"></el-table-column>
                    <el-table-column fixed="right" label="操作" width="130" align='center'>
                        <template slot-scope="scope">
                            <el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button>
                            <el-button @click="editPass(scope.row)" type="text" size="small">修改密码</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </div>
        <!-- 修改信息 添加账号 -->
        <el-dialog :title="dialogtitle" :visible.sync="dialogFormVisible" width="50%" center>
            <el-form label-width="130px" :model="form" :rules="rules" ref="form">
                <el-form-item label="账号" prop="a_account">
                    <el-input v-model="form.a_account" placeholder="请输入账号"></el-input>
                </el-form-item>
                <el-form-item label="姓名" prop="a_user_name">
                    <el-input v-model="form.a_user_name" placeholder="请输入姓名"></el-input>
                </el-form-item>
                <el-form-item label="性别" prop="a_sex">
                    <el-select v-model="form.a_sex" placeholder="请选择性别">
                        <el-option label="男" value="1"></el-option>
                        <el-option label="女" value="2"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="手机号" prop="a_phone">
                    <el-input v-model="form.a_phone" placeholder="请输入手机号"></el-input>
                </el-form-item>
                <el-form-item label="紧急联系人" prop="a_emergency">
                    <el-input v-model="form.a_emergency" placeholder="请输入紧急联系人"></el-input>
                </el-form-item>
                <el-form-item label="紧急联系人电话" prop="a_emergency_phone">
                    <el-input v-model="form.a_emergency_phone" placeholder="请输入紧急联系人电话"></el-input>
                </el-form-item>
                <el-form-item label="现住地址" prop="a_address">
                    <el-input v-model="form.a_address" placeholder="请输入现住地址"></el-input>
                </el-form-item>
                <el-form-item label="籍贯" prop="a_native_place">
                    <el-input v-model="form.a_native_place" placeholder="请输入籍贯"></el-input>
                </el-form-item>
                <el-form-item label="账号状态" prop="a_status">
                    <el-select v-model="form.a_status" placeholder="请选择账号状态">
                        <el-option label="启用" value="1"></el-option>
                        <el-option label="禁用" value="2"></el-option>
                    </el-select>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="cancel('form')">取 消</el-button>
                <el-button type="primary" @click="submitForm('form')">确 定</el-button>
            </div>
        </el-dialog>
        <!-- 修改密码 -->
        <el-dialog title="修改密码" :visible.sync="editPassVisible" width="50%" center>
            <el-form label-width="130px" :model="password" :rules="rulePass" ref="password">
                <el-form-item label="旧密码" prop="oldpass">
                    <el-input type="password" v-model="password.oldpass" placeholder="请输入旧密码" auto-complete="off"></el-input>
                </el-form-item>
                <el-form-item label="新密码" prop="a_password">
                    <el-input type="password" v-model="password.a_password" placeholder="请输入新密码" auto-complete="off"></el-input>
                </el-form-item>
                <el-form-item label="确认密码" prop="a_password_again">
                    <el-input type="password" v-model="password.a_password_again" placeholder="请再次输入密码" auto-complete="off"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="cancelPass('password')">取 消</el-button>
                <el-button type="primary" @click="submitPass('password')">确 定</el-button>
            </div>
        </el-dialog>
    </div>
</template>
<script src='../../contral/adminaccountlist.js'></script>

